package jgl.vajra.kingkong.part.order.model;

import java.util.Map;

import io.reactivex.Observable;
import jgl.vajra.kingkong.bean.OrderEvaluateBean;
import jgl.vajra.kingkong.manager.AccountManager;
import jgl.vajra.kingkong.part.order.contract.OrderEvaluateContract;
import jgl.vajra.kingkong.widget.manager.RxJavaHttpManager;
import jgl.vajra.kingkong.widget.manager.retrofit.RetrofitJsonManager;
import jgl.vajra.kingkong.widget.utils.UIUtils;

public class OrderEvaluateModel extends OrderEvaluateContract.Model{
    @Override
    public Observable<OrderEvaluateBean> getOrderEvaluateData(Map<String, Object> map) {
        return RetrofitJsonManager.getInstance().getApiService().getOrderEvaluateData(map)
                .compose(RxJavaHttpManager.applyTransformer());
    }

    @Override
    public Observable<Object> submitCommentsData(Map<String, Object> map) {
        return RetrofitJsonManager.getInstance().getApiService().submitCommentsData(map, AccountManager.getInstance().getLoginData(UIUtils.getContext()).authorization)
                .compose(RxJavaHttpManager.applyTransformer());
    }
}
